package bao

import "hxzkx/global/model"

func QueryCommonLocations(user_id int) ([]model.CommonLocation, error) {
	var DB = model.DB.Model(&model.User{})
	DB.Joins("join common_locations on common_locations.user_id = users.id")
	DB.Where("users.id = ?", user_id)
	var list []model.CommonLocation
	err := DB.Find(&list).Error
	return list, err
}
func InsertLocationRecord(record model.LocationRecord) error {
	if err := model.DB.Commit().Error; err != nil {
		return err
	}
	return nil
}
